package general;

/**
 * @Author 幻忧
 * @Date 2020/12/13 18:13
 * @Version 1.0
 * @Description 单例模式通用代码
 */
public class Singleton {
    private static final Singleton singleton = new Singleton();

    //限制产生多个对象
    private Singleton() {
    }

    //通过该方法获得实例对象
    public static Singleton getInstance() {
        return singleton;
    }

    //类中其他方法，尽量是static
    public static void doSomething() {

    }


}
